(function($){var detectedGEOCity='';var currentCountry=null;var currentCountrySettings=null;var ajaxRetryConfig={tryCount:0,retryLimit:3,retryDelay:3000,success:function(json){},error:function(xhr,textStatus,errorThrown){this.tryCount++;if(this.tryCount').text(msg).addClass('pl_form_error');phoneEl.after(errorEl);}else{$('#plErrorModal').find('.pl_modal_title').text('');$('#plErrorModal').find('.pl_modal_body').text(msg);openModal('#plErrorModal');} return false;} var initDmp=function(){(function(a,b,c,d,e,f,g){a['iDMPObject']={DMPData:true};a[e]=function(k,v){if(k==='match'){k='autoMatch';v=true;} a['iDMPObject'][k]=v;};f=b.createElement(c);f.id='iDMPFrame';f.src=d;f.style.width=0;f.style.height=0;f.style.border='none';f.style.visibility='hidden';f.style.position='fixed';f.style.right='200%';f.addEventListener("load",function(){if((typeof window.iDMPObject.autoMatch==='undefined')||(window.iDMPObject.autoMatch===true)){var frame=document.getElementById('iDMPFrame');frame=frame.contentWindow||frame;frame.postMessage(JSON.stringify(window.iDMPObject),"*");} window.iDMPData=Object.assign({},window.iDMPObject);window[e]=function(){if(arguments[0]==='match'){window.iDMPData.autoMatch=true;var frame=document.getElementById('iDMPFrame');frame=frame.contentWindow||frame;frame.postMessage(JSON.stringify(window.iDMPData),"*");} window.iDMPData[arguments[0]]=arguments[1];};});document.body.appendChild(f);window.addEventListener("message",function(event){if(event.data==='DMPClientDataReady'){document.dispatchEvent(new CustomEvent('DMPClientDataReady',{bubbles:true,detail:{},}));}});})(window,document,'iframe','//pixel.okometr.com/frame.html','idmps');idmps('clientId','eewmw1jvoghxr6eewnp1jvogmtik');idmps('accuracy',2);idmps('autoMatch',false);} var sendDStat=function(){var screen=window.screen;var timezone=detectTimezone();var conf=jQuery.extend({url:"/dStat",type:"POST",data:{width:typeof screen!='undefined'?screen.width:'',timezone:typeof timezone!='undefined'?timezone:''}},ajaxRetryConfig);$.ajax(conf);} var sendAddInfo=function(data){var conf=jQuery.extend({url:"/addInfo",type:"GET",data:data},ajaxRetryConfig);$.ajax(conf);} var sendAddStat=function(success){var conf=jQuery.extend({url:"/addStat",type:"GET"},ajaxRetryConfig);conf.success=success;$.ajax(conf);} var createOrder=function(success,error,data){var conf=jQuery.extend({url:"",type:"POST",data:data},ajaxRetryConfig);conf.success=success;conf.error=error;$.ajax(conf);} var sendGetP=function(success){var conf=jQuery.extend({url:"/getP",type:"POST"},ajaxRetryConfig);conf.success=success;$.ajax(conf);} var detectTimezone=function() {var timezone=false;if(typeof Intl!='undefined'&&typeof Intl.DateTimeFormat!='undefined'){timezone=Intl.DateTimeFormat().resolvedOptions().timeZone;} if(!timezone){if(typeof Date!='undefined'){var date=new Date();var offset=date.getTimezoneOffset();if(typeof offset=='number'){if(offset>0){timezone='Etc/GMT+'+Math.abs(offset/60);}else if(offset<0){timezone='Etc/GMT-'+Math.abs(offset/60);}else{timezone='Etc/GMT-0';}}}} return timezone;} var orderCreated=function(config) {if(typeof config.web_counters.fb!='undefined'){fbq('track','Lead');} var yandexMetrika=false;if(config.s_ym){yandexMetrika=config.s_ym;}else if(typeof config.web_counters.yandex!='undefined'){yandexMetrika=config.web_counters.yandex;} var yandexMetrikaTimeout=false;if(yandexMetrika){yandexMetrikaTimeout=setTimeout(function(){if(typeof yaCounter!='undefined'){yaCounter.reachGoal('orderCreated');yandexMetrikaTimeout=false;}},3000);} if(config.order_created.error) {$('#plErrorModal').find('.pl_modal_title').text('');$('#plErrorModal').find('.pl_modal_body').text(window.l_loc[config.order_created.error]);openModal('#plErrorModal');} else {if(typeof esk!='undefined'){esk('track','Conversion');} openModal('#plOrderCreatedModal');$('#plOrderCreatedModal .pl_modal_phone').text(config.order_created.phone);$('#plOrderCreatedModal .pl_btn_success').click(function(){if(yandexMetrika&&typeof yaCounter!='undefined'&&yandexMetrikaTimeout){yaCounter.reachGoal('orderCreated');clearTimeout(yandexMetrikaTimeout);} sendAddInfo({right:1});if(typeof config.order_created!='undefined'&&typeof config.order_created.subscribe_url!='undefined'){config.subscribe_url=config.order_created.subscribe_url;} if(config.is_subscribe){if(typeof config.subscribe_url!='undefined'&&config.subscribe_url){location.href=config.subscribe_url;}else{location.href="/subscribe";}}else{$('#plDuplicateOrderModal').find('.pl_modal_title').text('');$('#plDuplicateOrderModal').find('.pl_modal_body').text(window.l_loc.l_pl9);openModal('#plDuplicateOrderModal');} return false;});$('#plOrderCreatedModal .pl_btn_danger').click(function(){if(yandexMetrika&&typeof yaCounter!='undefined'&&yandexMetrikaTimeout){yaCounter.reachGoal('orderCreated');clearTimeout(yandexMetrikaTimeout);} sendAddInfo({right:0});closeModal();setTimeout(function(){$('input[name="order[phone]"]:first').focus();},500);return false;});}} var makeLocalization=function(config) {function prepareLoc(plc) {var text=window.l_loc[plc];text=text.replace('{{discount_price}}',parseInt(config.p_unload_price)+parseInt(config.p_old_price));text=text.replace('{{currency}}',config.s_currency);text=text.replace('{{unload_price}}',config.p_unload_price);if(text===undefined||!text){text='-- NO TRANSLATION --';} return text;} $('[l-loc]').each(function(key,el){var plc=$(el).attr('l-loc');html=prepareLoc(plc);$(el).html(html);});$('[l-loc-value]').each(function(key,el){var plc=$(el).attr('l-loc-value');text=prepareLoc(plc);$(el).attr('value',text);});} var initTraps=function(config) {var traps_started=false;var startT=function() {if(!traps_started) {traps_started=true;$("body").append($('